package com.nari.ruist.service.impl;

import java.util.List;

import com.nari.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nari.ruist.mapper.RstRequestMapper;
import com.nari.ruist.domain.RstRequest;
import com.nari.ruist.service.IRstRequestService;

/**
 * 请求实例主 Service业务层处理
 *
 * @author nari
 * @date 2021-04-02
 */
@Service
public class RstRequestServiceImpl implements IRstRequestService {
    @Autowired
    private RstRequestMapper rstRequestMapper;

    /**
     * 查询请求实例主
     *
     * @param id 请求实例主 ID
     * @return 请求实例主
     */
    @Override
    public RstRequest selectRstRequestById(Long id) {
        return rstRequestMapper.selectRstRequestById(id);
    }

    /**
     * 查询请求实例主 列表
     *
     * @param rstRequest 请求实例主
     * @return 请求实例主
     */
    @Override
    public List<RstRequest> selectRstRequestList(RstRequest rstRequest) {
        return rstRequestMapper.selectRstRequestList(rstRequest);
    }

    /**
     * 新增请求实例主
     *
     * @param rstRequest 请求实例主
     * @return 结果
     */
    @Override
    public int insertRstRequest(RstRequest rstRequest) {
        rstRequest.setCreateTime(DateUtils.getNowDate());
        return rstRequestMapper.insertRstRequest(rstRequest);
    }

    /**
     * 修改请求实例主
     *
     * @param rstRequest 请求实例主
     * @return 结果
     */
    @Override
    public int updateRstRequest(RstRequest rstRequest) {
        return rstRequestMapper.updateRstRequest(rstRequest);
    }

    /**
     * 批量删除请求实例主
     *
     * @param ids 需要删除的请求实例主 ID
     * @return 结果
     */
    @Override
    public int deleteRstRequestByIds(Long[] ids) {
        return rstRequestMapper.deleteRstRequestByIds(ids);
    }

    /**
     * 删除请求实例主 信息
     *
     * @param id 请求实例主 ID
     * @return 结果
     */
    @Override
    public int deleteRstRequestById(Long id) {
        return rstRequestMapper.deleteRstRequestById(id);
    }
}
